import * as actionTypes from '../../constants/ActionType';

const initialState = {
  userList:[]
};

const initUserInfo = {
  show:false,
  user:{}
};

export function userReducer(state = initialState, action){
  switch (action.type){
    case actionTypes.SEL_USER :
      let newData = action.data;
      console.log("呵呵");
      console.log(newData);
      return {
        ...state,
        ...newData
      };
    case actionTypes.DEL_USER:
      console.log('删除');
      return state;
    default :
      return state;
  }
}

export const userMakeReducer = (state = initUserInfo, action) => {
  console.log("xxxxxxxxxxxxxx");
  switch (action.type) {
    case actionTypes.SEL_USER_INFO:
    let newData = action.data;
    console.log("makeUserR");
    console.log(newData);
    return {
        ...state,
        ...newData
      }
    default:
      return state
  }
}
